home *** CD-ROM | disk | FTP | other *** search
/ InterCD 2000 September / september_2000.iso / intercd / root / ^Linux / cfengine-1.5.3 / inputs / cf.preconf.example < prev    next >
Encoding:
Text File  |  1999-04-22  |  1.4 KB  |  85 lines

  1. #!/bin/sh 
  2. #
  3. # cf.preconf is an emergency/bootstrap file to get things going
  4. # in case cfengine is unable to parse its config file
  5. #
  6.  
  7. backupdir=/iu/nexus/local/iu/etc
  8.  
  9.  #
  10.  # If thess files don't exist, you might not be able to parse cfengine.conf
  11.  #
  12.  
  13. if [ ! -s /etc/resolv.conf ]; then
  14.  
  15.  echo Patching basics resolv.conf file
  16.  cat > /etc/resolv.conf << XX
  17. domain iu.hioslo.no
  18. nameserver 128.39.89.10
  19. nameserver 158.36.144.156
  20. XX
  21.  
  22. fi
  23.  
  24. #
  25. # SVR4
  26. #
  27.  
  28. if [ "$1" = "solaris" ]; then
  29.  
  30.   if [ ! -s "/etc/passwd" ]; then
  31.  
  32.   echo Patching missing passwd file
  33.     /bin/cp $backupdir/passwd /etc/passwd
  34.   fi
  35.  
  36.   if [ ! -s "/etc/shadow" ]; then
  37.     
  38.    echo Patching missing passwd file
  39.    /bin/cp $backupdir/shadow /etc/shadow
  40.   fi 
  41.  
  42.  
  43.   if [ ! -s "/etc/group" ]; then
  44.  
  45.     echo Patching missing group file
  46.     /bin/cp $backupdir/group.solaris /etc/group
  47.  
  48.   fi
  49.  
  50.   if [ "`/bin/egrep dns /etc/nsswitch.conf`" = "" ]; then
  51.  
  52.      /bin/cp $backupdir/nsswitch.standalone /etc/nsswitch.conf
  53.  
  54.   fi
  55.  
  56. fi
  57.  
  58. #
  59. # BSD 4.3
  60. #
  61.  
  62. if [ "$1" = "linux" ]; then
  63.  
  64.    if [ ! -s "/etc/passwd"  ]
  65.    then
  66.     
  67.     echo Patching missing passwd file
  68.     /bin/cp $backupdir/passwd.linux /etc/passwd
  69.    fi
  70.  
  71.    if [ ! -s "/etc/group" ]
  72.    then
  73.     
  74.     echo Patching missing passwd file
  75.     /bin/cp $backupdir/group.linux /etc/group
  76.    fi
  77. fi
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.